package robocup.component.infotypes;

import robocup.component.ControllerNumbers.PLAY_MODE;

/**
 * This info represents a referee-message, by which a new play-mode is
 * announced.
 */
public class PlayModeInfo
    extends AuralInfo {

  /**
   * The new play-mode.
   */
  private PLAY_MODE playMode = PLAY_MODE.UNKNOWN;

  /**
   * An info-object containing a new PlayMode
   * 
   * @param iCycle -
   *          the time of the new playmode
   * @param iPlayMode -
   *          which playmode
   */
  public PlayModeInfo(
      final int iCycle,
      final PLAY_MODE iPlayMode) {

    super(iCycle);
    this.playMode = iPlayMode;
  }

  /**
   * Sets the new play-mode for this info-object.
   * 
   * @param playMode
   */
  public void setPlayModeType(final PLAY_MODE playMode) {

    this.playMode = playMode;
  }

  /**
   * Returns the PlayMode transmitted through the info message
   */
  public PLAY_MODE getPlayModeType() {

    return this.playMode;
  }

  /**
   * @return Returns a debug-string for this info-object.
   */
  @Override
  public String toString() {

    String s = "PLAY_MODE_";
    s += this.playMode.toString();
    return s;
  }
}
